package com.ruoyi.supermarket.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supermarket.mapper.PromotionMapper;
import com.ruoyi.supermarket.domain.Promotion;
import com.ruoyi.supermarket.service.IPromotionService;

/**
 * 促销管理Service业务层处理
 * 
 * @author xfq
 * @date 2024-07-22
 */
@Service
public class PromotionServiceImpl implements IPromotionService 
{
    @Autowired
    private PromotionMapper promotionMapper;

    /**
     * 查询促销管理
     * 
     * @param promotionId 促销管理主键
     * @return 促销管理
     */
    @Override
    public Promotion selectPromotionByPromotionId(Long promotionId)
    {
        return promotionMapper.selectPromotionByPromotionId(promotionId);
    }

    /**
     * 查询促销管理列表
     * 
     * @param promotion 促销管理
     * @return 促销管理
     */
    @Override
    public List<Promotion> selectPromotionList(Promotion promotion)
    {
        return promotionMapper.selectPromotionList(promotion);
    }

    /**
     * 新增促销管理
     * 
     * @param promotion 促销管理
     * @return 结果
     */
    @Override
    public int insertPromotion(Promotion promotion)
    {
        return promotionMapper.insertPromotion(promotion);
    }

    /**
     * 修改促销管理
     * 
     * @param promotion 促销管理
     * @return 结果
     */
    @Override
    public int updatePromotion(Promotion promotion)
    {
        return promotionMapper.updatePromotion(promotion);
    }

    /**
     * 批量删除促销管理
     * 
     * @param promotionIds 需要删除的促销管理主键
     * @return 结果
     */
    @Override
    public int deletePromotionByPromotionIds(Long[] promotionIds)
    {
        return promotionMapper.deletePromotionByPromotionIds(promotionIds);
    }

    /**
     * 删除促销管理信息
     * 
     * @param promotionId 促销管理主键
     * @return 结果
     */
    @Override
    public int deletePromotionByPromotionId(Long promotionId)
    {
        return promotionMapper.deletePromotionByPromotionId(promotionId);
    }
}
